package com.hubstc.book_borrow.service.impl;

import com.hubstc.book_borrow.mapper.BookCategoryMapper;
import com.hubstc.book_borrow.pojo.Category;
import com.hubstc.book_borrow.service.BookCategoryService;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookCategoryServiceImpl implements BookCategoryService {

    @Resource
    private BookCategoryMapper bookCategoryMapper;

    @Override
    public void addCategory(Category category) {
        bookCategoryMapper.addCategory(category);
    }

    @Override
    public List<Category> findAllCategory() {
       return bookCategoryMapper.findAllCategory();
    }

    @Override
    public Category findCategoryById(int id) {
        return bookCategoryMapper.findCategoryById(id);
    }

    @Override
    public void updateCategory(Category category) {
        bookCategoryMapper.updateCategory(category);
    }

    @Override
    public void deleteCategory(int categoryId) {
        bookCategoryMapper.deleteCategory(categoryId);
    }
}
